Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TOPI][RELAY][ONNX] Scatter ND #7927

Merged
merged 6 commits into from
Apr 28, 2021
Merged

Conversation

mbrookhart
Copy link
Contributor

This PR refactors the relay scatter_nd op in two ways:

  1. scatter_nd now takes in a data tensor, and updates are scattered based on indices. The previous API assumed zero-initialization for the data.
  2. scatter_nd now has a "mode" argument to determine how to update the input data, either "add" or "update". This is to support the use cases as a gradient of gather_nd and to support the ONNX and pytorch APIs. TF also supports "max", "min", and "sub", which are not yet supported here.

This also adds ScatterND to the ONNX importer.

cc @tkonolige @altanh @jwfromm @masahi

python/tvm/topi/cuda/scatter.py Outdated Show resolved Hide resolved
python/tvm/topi/x86/scatter.py Outdated Show resolved Hide resolved
python/tvm/topi/cuda/scatter.py Outdated Show resolved Hide resolved
python/tvm/topi/scatter.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jwfromm jwfromm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, LGTM.

Copy link
Contributor

@altanh altanh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌

@jcf94 jcf94 merged commit 8fce895 into apache:main Apr 28, 2021
@jcf94
Copy link
Contributor

jcf94 commented Apr 28, 2021

Thanks! @mbrookhart @tkonolige @jwfromm @altanh

@mbrookhart mbrookhart deleted the onnx_scatter_nd branch April 28, 2021 16:13
echuraev pushed a commit to echuraev/tvm that referenced this pull request Apr 29, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
umangyadav pushed a commit to umangyadav/tvm that referenced this pull request May 5, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
* passing topi tests

* passing relay tests, needs better shape checking still

* support ONNX operator

* add shape checking back in

* fix lint

* update docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants